{layout name="admin:layout" /}
<div class="tipbox tipbox-message">
    <span class="fn-fb">友情提示:</span>
    <p class="gray">
        1、请打开微信开放平台置查看接口信息,网址:<a href="https://open.weixin.qq.com" target="_blank">https://open.weixin.qq.com</a><br /> 
        2、管理中心->第三方平台->创建第三方平台<br /> 
        3、授权的发起页域名/公众号开发域名/小程序服务器域名/小程序业务域名：(域名：<span class="red">{$Request.host}</span>)<br />     
        4、添加IP白名单为您的<span class="red">服务器IP</span>地址
    </p>
</div>
<form id="form" action="{url('sysyte/admin.setting/wechatOpen')}">
    <table class="formtable">
        <tr>
            <th>AppID:</th>
            <td><input class="input" datatype="*" type="text" name="app_id" value="{$info.app_id}" /></td>
        </tr>
        <tr>
            <th>AppSecret:</th>
            <td><input class="input w400" datatype="*" type="text" name="secret" value="{$info.secret}" /></td>
        </tr>
        <tr><th>授权事件接收:</th><td>{:url('system/event.WechatOpen/ticket','',true,true)}</td></tr><tr>
        <tr><th>消息与事件接收:</th><td>{$Request.root.true}/wechatopen/$APPID$/message</td></tr><tr>
        <th>消息校验Token:</th>
            <td class="button-group">
                <input id="token" readonly="readonly" datatype="alphanum" class="input w400 fn-left readonly" type="text" name="token" value="{$info.token}" />
                <button type="button" class="token button "><i class="iconfont icon-refresh_icon"></i></button> 
            </td>
        </tr>
        <tr>
            <th>消息加解密Key:</th>
            <td class="button-group">
                <input id="aes_key" readonly="readonly" datatype="alphanum" class="input w400 fn-left readonly" type="text" name="aes_key" value="{$info.aes_key}" />
                <button type="button" class="aes_key button "><i class="iconfont icon-refresh_icon"></i></button> 
            </td>
        </tr>
        <tr>
            <th></th>
            <td>
                <input type="submit" value="确定" class="button submit" />
                <input type="reset" value="重置" class="button button-blank" />
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
Do('base', 'layer', 'form', function () {
    $('#form').isForm();
    $('.token').click(function(){
        var key = randomWord(32,32,32)
        $('#token').val(key)
    })
    $('.aes_key').click(function(){
        var key = randomWord(43,43,43)
        $('#aes_key').val(key)
    })
})
</script>